<div class="layui-form" style="padding: 20px 0 0 0;">
  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || 0 }}">
    </script>
  <div class="layui-form-item">
    <label class="layui-form-label">素材分类</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/plugin/material/category/list" lay-done="layui.form.render();">
        <select name="category_id">
          {{#  layui.each(d.data, function(index, item){ }}
          <option value="{{ item.id }}" {{# if(d.params.category_id == item.id){ }}selected{{# } }}>{{ item.title }}</option>
          {{# }) }}
        </select>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">素材名称</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="text" name="title" value="{{ d.params.title || '' }}"  lay-verify="required" placeholder="请输入...(必填)" autocomplete="off" class="layui-input">
    </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">素材更新</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="radio" name="auto_update" value="0" title="不自动更新" {{# if(d.params.auto_update != 1){ }}checked{{# } }}/>
      <input type="radio" name="auto_update" value="1" title="自动更新" {{# if(d.params.auto_update == 1){ }}checked{{# } }}/>
    </script>
    </div>
    <div class="layui-form-mid layui-word-aux">自动更新:指编辑这个素材的时候,使用这个素材的地方也会同步更改为编辑后的内容。</div>
  </div>
  <div class="layui-form-item">
    <script type="text/html" template>
      <textarea class="layui-textarea" id="text-editor" name="content" rows="30">{{ d.params.content || '' }}</textarea>
    </script>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="material-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>